package xin.yangshuai.liteflow01.component;

import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;
import xin.yangshuai.liteflow01.entity.User;

@Component
public class LiteflowService {

    @Resource
    private FlowExecutor flowExecutor;

    public void testConfig() {
        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");

        response = flowExecutor.execute2Resp("chain1", "arg", User.class);


        User user = new User();

        response = flowExecutor.execute2Resp("chain1", null, user);

        System.out.println(response);
    }
}
